<?php
$tmp =
<<<EOF
//版权所有(C) 2014 www.ilinei.com
if(!defined('INIT')) exit('Access Denied');

\$mods = array();

EOF;

$code .= $tmp;

foreach ($table_list as $key => $table){
	$code .= "
\$mods[] = '{$table[IDENTITY]}';";
}

$table_path = '';
if($_var['gp_rdoCodeDir']) $table_path = '{$_var[mod]}/';

$tmp = 
<<<EOF


if(in_array(\$_var['mod'], \$mods)){
	if(\$_var['ac'] == 'main'){
		\$menu = menu_get_by_url('{\$ADMIN_SCRIPT}'."mod={\$_var[mod]}/main");
		\$menus = menu_format_url(menu_get_children(\$menu['MENUID'], \$_var['current']), \$ADMIN_SCRIPT);
		
		include_once view('/module/admin/view/main');
	}else{
		require_once ROOTPATH."/{$setting[SiteTheme]}/module/{$table_path}{\$_var[mod]}.function.php";
		require_once ROOTPATH."/{$setting[SiteTheme]}/module/{$table_path}{\$_var[mod]}.{\$_var[ac]}.php";
	}
	
	exit(0);
}
EOF;

$code .= $tmp;
?>